CIS 280 Data Visualization and Communication

Ch 6: Visualizing Amounts


Plots

  1. Bar plots
    1. Single category bar plots
    2. Grouped / Stacked bar plots
  2. Dot plots & Heatmaps

Use Cases

  1. To count the number of times each category appears for a discrete data
  2. To breakdown the total of some continuous variable by discrete variable

When to Use Each Type

  1. If we have a single category to count or one set of continuous values to sum, we can use a bar plot.
  2. If we have two or more sets of categories for which we want to show amounts, we can group or stack the bars.
  3. If we have two or more sets of categories for which we want to show amounts on an x-y axis, we can group or dot plots.
  4. If we want to see amount patterns in color

6.1 Bar Plots

6.2 Grouped & Stacked Bar Plots

If we have two or more sets of categories for which we want to show amounts, we can group or stack the bars.

Aggregating Categorical Data

6.3 Dot Plot

  1. Dot plots are scatter plots with one categorical axis (Y) and one continuous axis (X).
  2. Instead of using bars, we can also place dots at the location where the corresponding bar would end.
  3. They can be used to show changes between two (or more) points in time or between two (or more) conditions.

Aggregating Mixed Data

Pandas Group By
Group a dataframe by a categorical variable and compute some aggregate function on a continuous variable

6.3+ Heatmap

With px.imshow, each value of the data frame is represented as a heatmap pixel

Use imshow to plot 3 color images